import 'package:flutter/material.dart';

class Animated5Page extends StatefulWidget {
  const Animated5Page({super.key});

  @override
  State<Animated5Page> createState() => _Animated5PagePageState();
}

class _Animated5PagePageState extends State<Animated5Page>
    with SingleTickerProviderStateMixin {
  late AnimationController _controller;

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    _controller = AnimationController(
      vsync: this,
      duration: Duration(seconds: 2), //持续时间
    )..repeat(reverse: true);
  }

  @override
  void dispose() {
    // TODO: implement dispose
    _controller.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
          child: AnimatedIcon(icon: AnimatedIcons.close_menu, progress: _controller,size: 50,)
      ),
    );
  }
}
